package shop;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import shop.*;
import admin.*;

import com.opensymphony.xwork2.ActionSupport;
import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

import java.util.*;
import java.io.Reader;
import java.io.IOException;

public class GoodsDetailAction extends ActionSupport{
	
	public static Reader reader;
	public static SqlMapClient sqlMapper;
	
	private GoodsBean param;

	private int GOODS_NUM;
	private String GOODS_CATEGORY;
	private String GOODS_NAME;
	private String GOODS_SIZE;
	private int GOODS_PRICE;
	private String GOODS_CONTENT;
	private String GOODS_IMAGE;
	private int GOODS_AMOUNT;
	
	public  GoodsDetailAction() throws IOException
	{
		reader = Resources.getResourceAsReader("sqlMapConfig.xml");
		sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader);
		reader.close();		
		
	}
	public String execute() throws Exception {
		
		setGOODS_NUM(getGOODS_NUM());
		
		param = (GoodsBean)sqlMapper.queryForObject("selectOne-a",GOODS_NUM);
		return SUCCESS;
	}
	
	public GoodsBean getParam() {
		return param;
	}
	public void setParam(GoodsBean param) {
		this.param = param;
	}
	public int getGOODS_NUM() {
		return GOODS_NUM;
	}
	public void setGOODS_NUM(int GOODS_NUM) {
		this.GOODS_NUM = GOODS_NUM;
	}
	public String getGOODS_CATEGORY() {
		return GOODS_CATEGORY;
	}
	public void setGOODS_CATEGORY(String GOODS_CATEGORY) {
		this.GOODS_CATEGORY = GOODS_CATEGORY;
	}
	public String getGOODS_NAME() {
		return GOODS_NAME;
	}
	public void setGOODS_NAME(String GOODS_NAME) {
		this.GOODS_NAME = GOODS_NAME;
	}
	public String getGOODS_SIZE() {
		return GOODS_SIZE;
	}
	public void setGOODS_SIZE(String GOODS_SIZE) {
		this.GOODS_SIZE = GOODS_SIZE;
	}
	public int getGOODS_PRICE() {
		return GOODS_PRICE;
	}
	public void setGOODS_PRICE(int GOODS_PRICE) {
		this.GOODS_PRICE = GOODS_PRICE;
	}
	public String getGOODS_CONTENT() {
		return GOODS_CONTENT;
	}
	public void setGOODS_CONTENT(String GOODS_CONTENT) {
		this.GOODS_CONTENT = GOODS_CONTENT;
	}
	public String getGOODS_IMAGE() {
		return GOODS_IMAGE;
	}
	public void setGOODS_IMAGE(String GOODS_IMAGE) {
		this.GOODS_IMAGE = GOODS_IMAGE;
	}
	public int getGOODS_AMOUNT() {
		return GOODS_AMOUNT;
	}
	public void setGOODS_AMOUNT(int GOODS_AMOUNT) {
		this.GOODS_AMOUNT = GOODS_AMOUNT;
	}
}
